Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Printing Tree for MultiIndex Columns #120

Merged

Conversation

michaelmckinsey1
Copy link
Collaborator

Summary

MultiIndex columns do not occur natively in Hatchet, however Thicket has some cases where the columns in a Thicket.statsframe.dataframe will become MultiIndex. This is relevant since the Thicket.statsframe is a Hatchet.GraphFrame, so to support printing the Thicket.statsframe.tree(), there must be a separate check for MultiIndex columns in Hatchet. This should not impact the functionality of Hatchet users using GraphFrame.tree(), since the GraphFrame.dataframe wont be MultiIndex if only using Hatchet by itself.

Current Issue

The current code dataframe.loc[df_index, self.name] returns a series when the columns are MultiIndex, which looks unsightly in the tree printout. We can avoid this by slightly tweaking the format to index directly to the string value.

image

Why hasn't this been an issue before?

Thicket.tree() prints on the Thicket.statsframe.dataframe aswell, but it handles this case appropriately by checking for the MultiIndex. So the current Thicket.tree() function can be used to avoid this problem. However, once LLNL/thicket#118 is merged, the Thicket.tree() will print on the Thicket.dataframe instead of the statsframe. Therefore, this functionality is necessary to continue to support both Thicket.tree() and Thicket.statsframe.tree().

@michaelmckinsey1 michaelmckinsey1 added area-graphframe Issues and PRs involving Hatchet's core GraphFrame datastructure and associated classes priority-normal Normal priority issues and PRs status-ready-for-review This PR is ready to be reviewed by assigned reviewers type-bug Identifies bugs in issues and identifies bug fixes in PRs type-feature Requests for new features or PRs which implement new features area-visualization Issues and PRs involving any of the Hatchet provided visualizations labels Mar 26, 2024
@slabasan slabasan merged commit fe68b12 into LLNL:develop Apr 8, 2024
3 checks passed
@michaelmckinsey1 michaelmckinsey1 deleted the feature-support_multiindex_tree branch April 9, 2024 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-graphframe Issues and PRs involving Hatchet's core GraphFrame datastructure and associated classes area-visualization Issues and PRs involving any of the Hatchet provided visualizations priority-normal Normal priority issues and PRs status-ready-for-review This PR is ready to be reviewed by assigned reviewers type-bug Identifies bugs in issues and identifies bug fixes in PRs type-feature Requests for new features or PRs which implement new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants